﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DrivingCRM.Controller;

namespace DrivingCRM.Views.Private.CRM
{
    public partial class AddMarks : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void AddMark_Click(object sender, EventArgs e)
        {
            string ret = EntityManager.AddMark(DateTime.Now, int.Parse(this.MarkTextBox.Text), int.Parse(this.DDL_Event.SelectedValue), Guid.Parse(this.DDL_Client.SelectedValue));
            if (ret == "No error")
                this.L_ErrorMessage.Text = "The new event was successfully added.";
            else
                ///this.L_ErrorMessage.Text = "An error occurred during the creation of the new event. Please fill the required fields.";
                this.L_ErrorMessage.Text = ret;
        }
    }
}